package com.Test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

public class Test35 {
    public static void main(String[] args) {

        ArrayList<HashMap<String, Object>> arrayList = new ArrayList<>();
        HashMap<String, Object> hashMap = new LinkedHashMap<>();
        hashMap.put("id", 1);
        hashMap.put("code", 456);
        hashMap.put("name", "小凯");
        arrayList.add(hashMap);

        HashMap<String, Object> hashMap1 = new LinkedHashMap<>();
        hashMap1.put("id", 2);
        hashMap1.put("code", 789);
        hashMap1.put("name", "小明");
        arrayList.add(hashMap1);

        for (HashMap<String, Object> objectHashMap : arrayList) {
            for (Map.Entry<String, Object> objectEntry : objectHashMap.entrySet()) {
                String key = objectEntry.getKey();
                Object value = objectEntry.getValue();
                System.out.println("键为:" + key + ",值为:" + value);
            }
        }
    }
}
